cmake_minimum_required(VERSION 3.10.0)

project(ZeDisk VERSION 0.1.0 LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 17)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)

option(ENABLE_ASAN "Enable AddressSanitizer" OFF)

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    if (ENABLE_ASAM)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
    endif ()
    option(ENABLE_DEBUG "Enable Debug" ON)
    message(STATUS "SELF -- Enable Debug")
endif ()

find_package(Libevent REQUIRED)

add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(gui)
add_subdirectory(server)
# add_subdirectory(test)


set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
